package com.example.homegroup.home.model;

import com.example.homegroup.home.data.Api;
import com.example.homegroup.home.data.HomeGoodsEntity;
import com.example.mvvmcommon.mvvm.model.BaseModel;
import com.example.networkmoudel.ChangeFunction;
import com.example.networkmoudel.HttpFactory;
import com.example.networkmoudel.HttpType;
import com.example.networkmoudel.entity.BaseEntity;

import java.util.Map;

import io.reactivex.Observable;

public class HomeModel extends BaseModel {
    public Observable<BaseEntity> requestHomeGoods(Map<String,Object> map){
        return HttpFactory.getInstance().factory(HttpType.TOKENSIGNTYPE)
                .getRetrofit().create(Api.class)
                .requestGoods(cteateBody(map))
                .map(new ChangeFunction<HomeGoodsEntity>());

    }
}
